home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir26
/
epi601_2.zip
/
FILES06.EXE
/
ENTTYPES.INC
< prev
next >
Wrap
Text File
|
1994-08-22
|
13KB
|
278 lines
const
TNNearlyZero = 1E-015;
Infinity = 1E+50;
RealSize = 8;
MaxToken = 25;
MaxVars = 20;
type
Float = Double; { 8 byte real, requires 8087 math chip }
String80 = String [80];
Alfa = Packed Array [1 .. 10] of Char;
String20 = String [20];
StringPtr = ^ String;
LongStrPtr = ^ String;
PtrListPtr = ^ ListPtr;
ListPtr = record {for a simple linked list of pointers}
next : PtrListPtr;
ptr : pointer;
end;
TokenString = String [MaxToken];
FilePtr = ^ ByteFile;
ByteFile = File of Byte;
ValueRecord = Packed Record
Case Integer of
0: (IntVal : Integer);
1: (RealVal : Float);
2: (StrVal : String20)
End {ValueRecord};
LegalPtr = ^ LegalRecord;
LegalRecord = Packed Record
Value : ValueRecord;
NewValue : ValueRecord;
IsNew : Boolean;
Next : LegalPtr
End {LegalRecord};
EntryType = (Numeric, Alpha, Date, Uppercase, CheckBox, YesNo,
RealNum, PhoneNum, Time, LocalNum, TodayType,EuroDate,
IDNum, Res4, Res5);
FileRecPtr = ^ FileRecord;
CommandPtr = ^ CommandRec;
VarPtr = ^ VariableRec;
{ VariableRec is a node in a tree-structure. It contains a variable
type and, depending on that variable type, either a number or a
string. }
VarTypes = (VReal, VString, VDate, VEuroDate);
VariableRec = Packed Record
Name : String20;
Left : VarPtr;
Right : VarPtr;
Global : Boolean;
Cumulative : Boolean;
Missing : Boolean;
Width : Byte;
Decimals : Byte;
Case VarType : VarTypes of
VReal : (VFloat : Float);
VDate,
VEuroDate,
VString : (VAlfa : String80)
End {VariableRec};
FieldPtr = ^ FieldList;
FieldRecord = Record
EntryKind : EntryType;
EntryLen : Byte { 0 means no entry for this field };
Name : Alfa;
MustEnter : Boolean;
Repeated : Boolean;
QuestionX : Byte;
QuestionY : Integer;
QuestionC : Byte;
EntryX : Byte;
EntryY : Integer;
EntryColor : Byte;
FieldChar : Char;
Hidden : Boolean;
Decimals : Byte;
HasMin : Boolean;
FieldMin : ValueRecord;
HasMax : Boolean;
FieldMax : ValueRecord;
CommentLen : word;
MissingLegal : LegalPtr;
Jumps : LegalPtr;
CodeField : FieldPtr;
AutoJump : FieldPtr;
BeforeCmds : CommandPtr;
AfterCmds : CommandPtr;
NoEnter : Boolean;
CurColor : Byte;
KeyNum : Byte;
Unique : Boolean;
Question : String80;
HasSoundex : boolean;
HelpCommand : CommandPtr;
LegalsInFile : Boolean;
CodesInFile : Boolean;
case integer of
0 : (Legal : LegalPtr;
Codes : LegalPtr);
1 : (LegalFileRecPtr : FileRecPtr;
CodesFileRecPtr : FileRecPtr);
End;
FieldList = Record
Previous : FieldPtr;
Next : FieldPtr;
Missing : Boolean;
FieldInt : Integer;
FieldReal : Float;
FieldEntry : String80;
Field : FieldRecord;
firstEntry : String80;
End;
{ PtrRec is used to point to variables. Since there are two
kinds of variables used in the program, IsField determines
what type of variable the one pointed to is }
PtrRec = Packed Record
DoAll : Integer;
Case IsField : Boolean of
True: (FP : FieldPtr);
False: (VP : VarPtr)
End {PtrRec};
StackRecPtr = ^ StackRec;
StackPtr = ^ StackType;
{ StackRecord is the basic stack data structure. It consists
of a type identifier (ExpType) followed by four variant parts.
If the type is VarExp, then VarHole is an index into the VarArray
in the StackType, which contains a pointer to the proper variable.
This allows the stack to be built once, and the variable's value
put into the proper position in the stack automatically, without
having to rebuilt. }
ExpKind = (NumExp, OpExp, VarExp, StrExp, StrDateExp, StrEuroExp,
DateExp, MissExp);
OpType = (AddOp, SubOp, MulOp, DivOp, ExptOp,
RParen, LParen, LessOp, GreatOp, LessEqOp,
GreatEqOp, NotEqualOp, EqualOp, AndOp, OrOp,
IntDivOp, NotOp, RndOp, LogOp, LnOp,
RandomOp, ExpOp, StripOp, EndOp, DummyOp);
StackRecord = Packed Record
Case ExpType : ExpKind of
NumExp, DateExp :
(Num : Float);
OpExp:
(Op : OpType);
VarExp :
(VarHole : Integer;
SubPos : Byte;
SubLen : Byte);
StrExp, StrDateExp, StrEuroExp:
(MatchPos : Integer;
StackIdx : Byte { Index into string stack };
St : TokenString)
End {StackRecord};
StackRec = Packed Record
Next : StackRecPtr;
Rec : StackRecord
End {StackRec};
{ Stacktype contains the standard stack data structures, as well as an
array of pointers to variables. This allows the program to build
the stack once, and stick the variables in the correct holes every
time the stack needs evaluating, rather than rebuilding the stack
every time it's needed }
StackType = Packed Record
Top : Integer;
VarArray : Packed Array [1 .. MaxVars] of PtrRec;
S : StackRecPtr;
PopPtr : StackRecPtr
End {StackType};
Commands = (CmdIF, CmdLET, CmdJUMP, CmdTYPE, CmdHELP,
CmdCLEAR, CmdCOLOR, CmdLOAD, CmdUNLOAD, CmdVALIDATE,
CmdUPDATE, CmdAUTOSEARCH, CmdKEY, CmdEXIT, CmdINCLUDE,
CmdTYPECOMMENT, CmdHIDE, CmdUNHIDE, CmdFIELDCHAR,
CmdDEFINE, CmdRELATE, CmdENTER, CmdCOMMENT);
CommandRec = Record
NextCommand : CommandPtr;
Case Command : Commands of
CmdIF:
(IfExpression : StackPtr;
IfCmds : CommandPtr;
ElseCmds : CommandPtr);
CmdLET:
(Variable : PtrRec;
LetExp : StackPtr);
CmdJUMP:
(JumpEOR : Boolean;
JumpVar : FieldPtr);
CmdCLEAR:
(ClearAll : Boolean;
ClearVar : FieldPtr);
CmdHIDE,
CmdUNHIDE,
CmdFIELDCHAR :
(SetAll : Boolean;
SetVar : FieldPtr;
SetData : Integer);
CmdTYPE,CmdTYPECOMMENT:
(TypeFile : Boolean;
TypeString : LongStrPtr;
XRelative : Boolean;
X : ShortInt;
YRelative : Boolean;
Y : ShortInt;
TypeColor : Integer);
CmdHELP:
(HelpFile : Boolean;
HelpString : LongStrPtr;
HelpXRel : Boolean;
HelpX : ShortInt;
HelpYRel : Boolean;
HelpY : ShortInt;
HelpTopic : Word;
HelpKeys : LongStrPtr);
CmdCOLOR:
(DSetType : Integer;
DataColor : Integer;
QSetType : Integer;
QuesColor : Integer;
ColorField : FieldPtr);
CmdLOAD, CmdUNLOAD:
(LoadModule : LongStrPtr;
Default : Boolean);
CmdVALIDATE:
(CallModule : String [8];
CallParam : Integer);
CmdUPDATE:
(UpdateParam : (UpdateOn, UpdateScr, UpdateOff));
CmdENTER,
CmdRELATE:
(RelatedFile : Word;
RelatedField : FieldPtr { Points to master field };
RelatedName : Alfa;
RepeatCount : Integer);
CmdCOMMENT:
(CommentText : LongStrPtr);
CmdAUTOSEARCH :
(UseSoundex : boolean;
ListAll : boolean;
ASFields : PtrListPtr);
End {CommandRec};
FileStatusType = (FilePurged, FileRead, FileNotFound);
FileBlockStatus = (FileRelated, FileNoKey, FileUnrelated);
MapTypeS = (OneToOne, OneToMany);
RelationPtr = ^ RelationRecord;
RelationRecord = Record
FatherField : FieldPtr;
SonField : Alfa;
SonFile : Byte;
MapType : MapTypeS;
Condition : StackPtr { NIL = Unconditional };
Next : RelationPtr
End {RelationRecord};
FileRecord = Record
FileName : StringPtr {'' =File rec empty};
RecSize : Integer { 0 =Uninitialized };
DataOffset : Word { 0 =Uninitialized };
RecordNum : LongInt {-1 =EOF };
IsDeleted : Boolean {False};
LocalVarHeader : VarPtr;
QHeader : FieldPtr {NIL =Purged };
InitCommands : CommandPtr {NIL=None}; {called once for file}
DoneCommands : CommandPtr {NIL=None}; {called once for file}
PreCommands : CommandPtr {NIL=None}; {called once per record}
PostCommands : CommandPtr {NIL=None}; {called once per record}
DataStatus : FileStatusType {FilePurged};
ChkStatus : FileStatusType {FilePurged};
{ * Context saving information for switching files * }
CurQuestion : FieldPtr {NIL};
CurLine : Integer {0};
TopLine : Integer {0};
BottomLine : Integer {0};
DataChanged : Boolean {False};
F : ByteFile;
IndexStatus : FileStatusType {FilePurged};
Relations : RelationPtr {NIL =No relations};
FileStatus : FileBlockStatus {FileRelated};
NKeys : Byte {0};
MustSave : Boolean; { KAB 09/16/91 }
IsVerified : Boolean;
End { FileRecord};